import {
  GraphQLList,
  GraphQLObjectType,
  GraphQLSchema,
  GraphQLString,
  GraphQLInt,
  GraphQLFloat,
  GraphQLEnumType,
  GraphQLNonNull
} from 'graphql';

export default new GraphQLObjectType({
  name: 'DailySummery',
  description: '日线数据',
  fields: {
    date: {
      type: GraphQLInt,
      description: '日期`20170702`'
    },
    open: {
      type: new GraphQLNonNull(GraphQLFloat),
      description: '开盘价'
    },
    high: {
      type: new GraphQLNonNull(GraphQLFloat),
      description: '最高价'
    },
    low: {
      type: new GraphQLNonNull(GraphQLFloat),
      description: '最低价'
    },
    close: {
      type: new GraphQLNonNull(GraphQLFloat),
      description: '收盘价'
    },
    change: {
      type: new GraphQLNonNull(GraphQLFloat),
      description: '涨跌幅，复权之后的真实涨跌幅，保证准确'
    },
    volume: {
      type: GraphQLFloat,
      description: '成交量'
    },
    money: {
      type: GraphQLFloat,
      description: '成交额'
    },
    traded_market_value: {
      type: GraphQLFloat,
      description: '流通市值'
    },
    market_value: {
      type: GraphQLFloat,
      description: '总市值'
    },
    turnover: {
      type: GraphQLFloat,
      description: '换手率，成交量/流通股本'
    },
    adjust_price: {
      type: GraphQLFloat,
      description: '后复权价，复权开始时间为股票上市日，精确到小数点后10位'
    },
    report_type: {
      type: GraphQLFloat,
      description: '最近一期财务报告的类型，3-31对应一季报，6-30对应半年报，9-30对应三季报，12-31对应年报'
    },
    report_date: {
      type: GraphQLFloat,
      description: '最近一期财务报告实际发布的日期'
    },
    PE_TTM: {
      type: GraphQLFloat,
      description: '最近12个月市盈率，股价 / 最近12个月归属母公司的每股收益TTM'
    },
    PS_TTM: {
      type: GraphQLFloat,
      description: '最近12个月市销率， 股价 / 最近12个月每股营业收入'
    },
    PC_TTM: {
      type: GraphQLFloat,
      description: '最近12个月市现率， 股价 / 最近12个月每股经营现金流'
    },
    PB: {
      type: GraphQLFloat,
      description: '市净率，股价 / 最近期财报每股净资产'
    },
    adjust_price_f: {
      type: GraphQLFloat,
      description: '前复权价，复权开始时间为股票最近一个交易日，精确到小数点后10位'
    }
  }
})
